<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="${domain.moduleName}" >
	<class name="${domain.domainName}" table="${domain.tableName}">
		<#list domain.fieldMap?keys as x>
		<#assign v = domain.fieldMap[x]>
		<#if v.pk>
		<id name="${v.name}" column="${v.id}">
			<generator class="${v.generator}" />
		</id>
		<#elseif v.foreign>
		<many-to-one name="${v.name}" column="${v.id}" not-null="${v.notNull?string}" unique="${v.unique?string}"/>
		<#else>
		<property name="${v.name}" column="${v.id}" not-null="${v.notNull?string}" unique="${v.unique?string}"/>
		</#if>
		</#list>
	</class>
</hibernate-mapping>